Skip to content

refactor(harness): remove legacy browser graph entry points (SAP-3090) - #907

Open
ynadge wants to merge 1 commit into
yashnadge/sap-3089-agent-studio-complete-durable-map-authority-and-retirementfrom
yashnadge/sap-3090-remove-legacy-browser-entrypoints
Open

refactor(harness): remove legacy browser graph entry points (SAP-3090)#907
ynadge wants to merge 1 commit into
yashnadge/sap-3089-agent-studio-complete-durable-map-authority-and-retirementfrom
yashnadge/sap-3090-remove-legacy-browser-entrypoints

Conversation

@ynadge

@ynadge ynadge commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Primary change type

  • Bug fix
  • Documentation
  • Feature
  • Tests
  • Dependency update
  • Maintenance or refactor

Problem and motivation

A server that omitted the durable project catalog could still send project selection through the legacy graph or an implicit conversation handoff. Project selection now stays on the durable Agent Map identity and recovery path.

Summary and scope

Remove the old screen mount and older-server session handoff. Preserve the selected project and conversation during identity recovery, exact keyboard tabs, independent Canvas/Steps, mobile controls, and map/agent history. Best-effort workspace preference writes now handle rejection. This is the first of two browser layers; the next layer deletes the disconnected implementation.

Related work

Related issue or discussion: SAP-3090. Part of the authorized cleanup stack above #892 and #893, targeting main. Human review follows the complete stack. Implementation and PR creation do not authorize merging or releasing it.

Validation

Verification on the cumulative implementation at cab477b5 (each earlier boundary also passed its affected build/typecheck and focused checks):

pnpm build — passed
pnpm typecheck — passed
pnpm lint — passed (existing warnings)
pnpm test — stops at the unchanged agent-core unreadable-directory test on this VM
pnpm --filter @sapiom/harness exec vitest run --maxWorkers=2 — 3,840 passed, 2 skipped
pnpm --filter @sapiom/harness test:perf — 10 passed
pnpm -r --filter @sapiom/mcp --filter @sapiom/cli --filter @sapiom/harness-desktop test — passed (179 + 73 + 205 cases; 3 MCP skips)
pnpm terminology:check — passed
pnpm provider-copy:check — passed
pnpm examples:check:test — 178 passed
pnpm pr-labeler:check — passed
pnpm pr-ci-security:check — passed

The root test failure reproduces on unchanged prior code; it is not treated as a green root run. The final retirement record includes artifact hashes, request-observation scope and all local limitations.

pnpm --filter @sapiom/harness test:ui --config /home/vercel-sandbox/sapiom/.context/sap-3089/playwright.config.mjs --workers=3 — 625/627 passed; two Chrome target crashes
pnpm --filter @sapiom/harness test:ui --config /home/vercel-sandbox/sapiom/.context/sap-3089/playwright.config.mjs --workers=2 template-harness — full affected file passed 23/23 unchanged
pnpm --filter @sapiom/harness test:canvas --config /home/vercel-sandbox/sapiom/.context/sap-3090-3091/playwright-canvas.config.mjs --workers=2 — 15 passed
node packages/harness-desktop/scripts/pack.mjs --linux — passed with copied dependencies and output redirected to task storage
bash packages/harness-desktop/scripts/smoke.sh — fresh linux-unpacked artifact passed 16 checks, 1 Windows-only skip
AppImage --appimage-extract-and-run --smoke --no-sandbox under Xvfb and the same isolated smoke setup — passed 16 checks, 1 skip on isolated rerun

Browser checks used installed Google Chrome, isolated TMPDIR and E2E_PORT=5497; the override changes only the executable, temporary output/report paths and Vite invocation. The package's 195 Harness runtime/assets match the clean build byte-for-byte. Its saved-map check records legacy read/refresh/navigation requests 0/0/0, direct removed routes 404/404/404, and unchanged map/history.

The first AppImage run failed session-create with a preexisting PROJECT_SESSION_SCOPE_UNAVAILABLE retention race; the identical artifact passed an isolated rerun. The initial failure and unchanged source ancestry are preserved in the record, with a separate follow-up test/fix outline. This cleanup does not fix that race. Signed macOS installer/upgrade evidence remains the SAP-3086 release gate.

Tests and documentation

Migrated retained project, mobile, navigation and shell tests to durable map fixtures. Added omitted-catalog recovery and exact keyboard cases; both new cases failed before the implementation. Retained standalone session fixtures remain independently usable. At this boundary, 195 focused unit cases passed; retained browser cases passed across the broad run and scoped reruns after fixture corrections.

Compatibility and release impact

  • Breaking or externally visible changes: Older servers without project identities show Reload projects. Project entry never starts, resumes or selects a conversation; explicit session controls remain available.
  • Changeset: Added .changeset/tall-maps-stay-durable.md for a Harness patch.

Security

  • I have not included secrets, credentials, private data, or unsanitized logs.
  • This pull request does not publicly disclose a suspected vulnerability. I will follow the Security Policy for private reporting.

AI assistance

  • I did not use AI assistance for this change.
  • I used AI assistance and have described it below.

Codex implemented the cleanup and test/doc migrations, traced retained callers, and checked the resulting diffs. Automated checks above and independent read-only review provide implementation evidence; maintainer review is still required.

Checklist

  • I read CONTRIBUTING.md, and this contribution follows the direct-PR or issue-first policy.
  • This pull request addresses one focused problem and contains no unrelated cleanup.
  • I added or updated tests, or explained above why tests are not applicable.
  • I ran the relevant build, typecheck, lint, and test commands, or explained any N/A checks above.
  • I updated documentation for user-facing changes, or marked it N/A above.
  • I added a Changeset for a published-package change, or explained why it is not applicable.
  • I can explain and maintain every submitted change, including any AI-assisted work.

Summary by CodeRabbit

  • New Features

    • Project selection now uses durable Studio identity and opens the appropriate Agent Map recovery state when project information is missing or incomplete.
    • Agent Map navigation preserves conversation selection and supports reliable Back/Forward behavior.
    • On mobile, selecting a project opens the Agent Map in the right-hand pane.
  • Changes

    • The older workspace graph and legacy server fallback are no longer available.
    • Canvas and Steps remain independent views during regular sessions.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a05f329c-068d-4b96-a55b-249d51e8da45

📥 Commits

Reviewing files that changed from the base of the PR and between e4003c9 and 42fcacc.

📒 Files selected for processing (14)
  • .changeset/tall-maps-stay-durable.md
  • docs/plans/agent-studio-plan-first-agent-map/authority-retirement.md
  • packages/harness/web/e2e/agent-map-authority.spec.ts
  • packages/harness/web/e2e/agent-map-navigation.spec.ts
  • packages/harness/web/e2e/group-axis.spec.ts
  • packages/harness/web/e2e/mobile.spec.ts
  • packages/harness/web/e2e/polsia-workspace.spec.ts
  • packages/harness/web/e2e/project-altitude.spec.ts
  • packages/harness/web/e2e/project-axis.spec.ts
  • packages/harness/web/e2e/project-map-groups.spec.ts
  • packages/harness/web/e2e/smoke.spec.ts
  • packages/harness/web/src/App.tsx
  • packages/harness/web/src/lib/api.ts
  • packages/harness/web/src/lib/use-harness-state.ts
💤 Files with no reviewable changes (3)
  • packages/harness/web/e2e/polsia-workspace.spec.ts
  • packages/harness/web/e2e/group-axis.spec.ts
  • packages/harness/web/e2e/project-map-groups.spec.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The harness removes the legacy workspace graph and session-handoff paths. Project selection now uses durable Studio identity and Agent Map recovery. E2E coverage shifts to Agent Map navigation, older-protocol recovery, and independent Canvas and Steps behavior.

Changes

Agent Map authority retirement

Layer / File(s) Summary
Remove legacy runtime paths
packages/harness/web/src/App.tsx, packages/harness/web/src/lib/use-harness-state.ts, packages/harness/web/src/lib/api.ts
Project selection and rendering no longer use WorkspaceGraphView, legacy session handoff, or system-graph cache invalidation. Missing identity uses the Agent Map recovery state.
Validate durable identity and map navigation
packages/harness/web/e2e/agent-map-authority.spec.ts, packages/harness/web/e2e/agent-map-navigation.spec.ts, packages/harness/web/e2e/project-altitude.spec.ts, packages/harness/web/e2e/mobile.spec.ts
E2E coverage adds older-protocol identity recovery and updates navigation, pane, disclosure, mobile, and Back/Forward assertions to Agent Map surfaces.
Retire legacy graph coverage
packages/harness/web/e2e/polsia-workspace.spec.ts, packages/harness/web/e2e/project-map-groups.spec.ts, packages/harness/web/e2e/group-axis.spec.ts, packages/harness/web/e2e/project-axis.spec.ts, packages/harness/web/e2e/smoke.spec.ts, docs/plans/agent-studio-plan-first-agent-map/authority-retirement.md, .changeset/tall-maps-stay-durable.md
Legacy graph-specific tests are deleted or updated to use Studio fixtures. The authority plan and changeset document the retired fallback and durable project behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProjectSelection
  participant App
  participant AgentMapPane
  participant useHarnessState
  ProjectSelection->>App: select project
  App->>AgentMapPane: render selected or unresolved project
  useHarnessState->>App: ignore system-graph.changed
  App->>AgentMapPane: display Agent Map or recovery state
Loading

Suggested reviewers: gwitwer

Merge Risk: ⚪ Minimal · up to 42fca

The legacy graph path is retired while project selection and recovery remain covered by the durable Agent Map flow. No merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 9 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: removing legacy browser graph entry points from Harness.
Description check ✅ Passed The description completes the required sections, explains the motivation and scope, documents related work, validation results and limitations, compatibility impact, changeset, security, AI assistance…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 9 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yashnadge/sap-3090-remove-legacy-browser-entrypoints

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit hops where old graphs fade
Durable maps now guide the way
No phantom handoffs cross the night
Canvas and Steps keep their own flight
Agent Maps bloom in steady light

Comment @coderabbitai help to get the list of available commands.

@ynadge
ynadge added this pull request to stack #894 September 9, 2026 23:15
@ynadge
ynadge marked this pull request as ready for review September 10, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant